﻿using System;
using System.Drawing;
using System.Windows.Forms;

namespace Rename.UC.组合
{
    public partial class Uc编号设置 : UserControl
    {
        public Uc编号设置()
        {
            InitializeComponent();
        }

        private void Uc编号设置_Load(object sender, EventArgs e)
        {
            uc第个字符后1.Visible = false;
            uc随机字符1.Visible = false;
            uc字母1.Visible = false;
            uc时间1.Visible = false;
            uc数字1.Visible = true;
            uc数字1.Location = new Point(8, 70);
        }

        private void chkBhSetting_CheckedChanged(object sender, EventArgs e)
        {
            grp位置.Enabled = chkBhSetting.Checked;
            grp类型.Enabled = chkBhSetting.Checked;
            if (chkBhSetting.Checked == false)
            {
                chkBhAsFileName.Checked = false;
            }
        }

        private void chkBhAsFileName_CheckedChanged(object sender, EventArgs e)
        {

        }

        private void radWzCustom_CheckedChanged(object sender, EventArgs e)
        {
            RadioButton rad = sender as RadioButton;
            string text = rad.Text;
            if (text.Equals("自定义") == true && rad.Checked == true)
            {
                uc第个字符后1.Visible = true;
            }
            else
            {
                uc第个字符后1.Visible = false;
            }
        }

        private void grp类型Rad_CheckedChanged(object sender, EventArgs e)
        {
            RadioButton rad = sender as RadioButton;
            if (rad.Checked == true)
            {
                string text = rad.Text;
                switch (text)
                {
                    case "数字":
                        uc数字1.Visible = true;
                        uc字母1.Visible = false;
                        uc随机字符1.Visible = false;
                        uc时间1.Visible = false;
                        //uc字母1.Location = uc数字1.Location;
                        break;
                    case "字母":
                        uc数字1.Visible = false;
                        uc字母1.Visible = true;
                        uc随机字符1.Visible = false;
                        uc时间1.Visible = false;
                        uc字母1.Location = uc数字1.Location;
                        break;
                    case "随机字符":
                        uc数字1.Visible = false;
                        uc字母1.Visible = false;
                        uc随机字符1.Visible = true;
                        uc时间1.Visible = false;
                        uc随机字符1.Location = uc数字1.Location;
                        break;
                    case "时间":
                        uc数字1.Visible = false;
                        uc字母1.Visible = false;
                        uc随机字符1.Visible = false;
                        uc时间1.Visible = true;
                        uc时间1.Location = new Point(uc数字1.Location.X, uc数字1.Location.Y-10);
                        break;
                    default:
                        break;
                }
            }
        }
    }
}
